***********************************************************************************************************************
**** Table A16. Coarsened Exact Matching ******************************************************************************
***********************************************************************************************************************


use "$data/Non_payment_dataset_ready.dta" , clear

log using "$filepath/output_logs/other stats", replace

**** Other statistics mentioned in text ****


** Number of customers at intervention start 
tab t if payment!=. & invoices!=. & itt!=. //There are 9,823 customers at t=14

* Average customer's debt
gen lastdso=preclosingbalance/premeaninvoice
winsor lastdso, gen(lastdsow) p(0.01)
sum lastdsow if t==12 & itt!=. // The average customer has 3.4 unpaid water bills


** Overall cost-effectiveness of intervention
tab itt if t==14 & payment!=. & invoices!=. // customers per treatment
di (((43.332+8.929*8)*3284 + (43.332+8.929*8 +17.4038+1.499*8)*3295 + (43.332+8.929*8 +46.573-1.047*8)*3244 ) / 9823)  / 13.5 // 10-11 USD  (1 USD=13.5 N$)


log close
